home *** CD-ROM | disk | FTP | other *** search
/ Aminet 51 / Aminet 51 (2002)(GTI - Schatztruhe)[!][Oct 2002].iso / Aminet / dev / c / TinyGL.lha / tinygl / src / zmath.h < prev    next >
Encoding:
C/C++ Source or Header  |  2000-10-15  |  917 b   |  54 lines

  1. #ifndef __ZMATH__
  2. #define __ZMATH__
  3.  
  4. /* Matrix & Vertex */
  5.  
  6. typedef struct {
  7.     float m[4][4];
  8. } M4;
  9.  
  10. typedef struct {
  11.     float m[3][3];
  12. } M3;
  13.  
  14. typedef struct {
  15.      float m[3][4];
  16. } M34;
  17.  
  18.  
  19. #define X v[0]
  20. #define Y v[1]
  21. #define Z v[2]
  22. #define W v[3]
  23.  
  24. typedef struct {
  25.      float v[3];
  26. } V3;
  27.  
  28. typedef struct {
  29.      float v[4];
  30. } V4;
  31.     
  32. void gl_M4_Id(M4 *a);
  33. int gl_M4_IsId(M4 *a);
  34. void gl_M4_Move(M4 *a,M4 *b);
  35. void gl_MoveV3(V3 *a,V3 *b);
  36. void gl_MulM4V3(V3 *a,M4 *b,V3 *c);
  37. void gl_MulM3V3(V3 *a,M4 *b,V3 *c);
  38.  
  39. void gl_M4_MulV4(V4 * a,M4 *b,V4 * c);
  40. void gl_M4_InvOrtho(M4 *a,M4 b);
  41. void gl_M4_Inv(M4 *a,M4 *b);
  42. void gl_M4_Mul(M4 *c,M4 *a,M4 *b);
  43. void gl_M4_MulLeft(M4 *c,M4 *a);
  44. void gl_M4_Transpose(M4 *a,M4 *b);
  45. void gl_M4_Rotate(M4 *c,float t,int u);
  46. int  gl_V3_Norm(V3 *a);
  47.  
  48. V3 gl_V3_New(float x,float y,float z);
  49. V4 gl_V4_New(float x,float y,float z,float w);
  50.  
  51. int gl_Matrix_Inv(float *r,float *m,int n);
  52.  
  53. #endif  __ZMATH__
  54.